<template>
	<view>
		<u-navbar title="个人资料" :autoBack="true" bgColor="#fff" :fixed="false"></u-navbar>
		<view class="p-30" style="margin-top: 60rpx;">
			<view class="flex-column align-center justify-center">
				<!-- <u-avatar :src="$userInfo.avatar" size="80"></u-avatar> -->
				<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
					:maxCount="1" multiple width="80" height="80">
					<image :src="add" mode="widthFix" style="width: 80px;height: 80px;border-radius: 50%;"></image>
				</u-upload>
			</view>
			<view class="card mt-30 p-30">
				<view class="flex-row justify-between align-center small-size">
					<view class="label gray-color">
						用户昵称
					</view>
					<view>
						{{$userInfo.nickname}}
					</view>
				</view>
				<u-line margin="30rpx 0" color="#eee"></u-line>
				<view class="flex-row justify-between align-center small-size">
					<view class="label gray-color">
						手机号
					</view>
					<view>
						{{$userInfo.mobile}}
					</view>
				</view>
				<u-line margin="30rpx 0" color="#eee"></u-line>
				<view class="flex-row justify-between align-center small-size">
					<view class="label gray-color">
						VIP等级
					</view>
					<view>
						<template v-if="$userInfo.vip_img">
							<u-image :src="$userInfo.vip_img" width="120rpx" height="30rpx"></u-image>
						</template>
						<navigator url="/pages/mine/vip" class="flex-row align-center justify-center">
							<view>查看</view>
							<u-icon name="arrow-right"></u-icon>
						</navigator>
					</view>
				</view>
				<u-line margin="30rpx 0" color="#eee"></u-line>
				<view class="flex-row justify-between align-center small-size">
					<view class="label gray-color">
						元宝数量
					</view>
					<view>
						{{$userInfo.money}}
					</view>
				</view>
				<u-line margin="30rpx 0" color="#eee"></u-line>
				<view class="flex-row justify-between align-center small-size">
					<view class="label gray-color">
						免费查看次数
					</view>
					<view>
						{{$userInfo.view < 0 ? '无' : $userInfo.view}}
					</view>
				</view>
			</view>
		</view>
		<view class="submit">
			<u-button @click="submit" type="error" text="保存" shape="circle"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex";
	import commonMixin from '@/mixins/common.js';
	import img from '@/mixins/img.js';
	export default {
		mixins: [commonMixin, img],
		data() {
			return {
				fileList1: []
			}
		},
		onLoad() {
			this.fileList1 = [{
				url: this.$userInfo.avatar,
			}]
		},
		methods: {
			submit() {},
		}
	}
</script>

<style>

</style>